Previous Book Contents Book Index Next

Inside Macintosh: QuickTime /
Chapter 2 - Movie Toolbox / Movie Toolbox Reference
Functions That Modify Movie Properties / Working With Media Time


SetMediaTimeScale

The SetMediaTimeScale function allows your application to set a media's time scale.

pascal void SetMediaTimeScale (Media theMedia, 
                               TimeScale timeScale);
theMedia
Specifies the media for this operation. Your application obtains this media identifier from such Movie Toolbox functions as NewTrackMedia and GetTrackMedia (described on page 2-138 and page 2-190, respectively).
timeScale
Specifies the media's new time scale.
DESCRIPTION
In response to this request, the Movie Toolbox attempts to adjust the edit list of the appropriate track so that movie playback is unaffected. If you change a media's time scale by setting it to a smaller value, you may lose precision in media time values. In general, you should only increase the time scale value, and you should try to use integer multiples of the existing time scale.

SPECIAL CONSIDERATIONS
Do not use SetMediaTimeScale as a general rule. If you call this function with a number that is not an integer multiple, the duration of the samples vary unpredictably, and their start times tend to drift.

ERROR CODES
invalidMedia-2008This media is corrupted or invalid

Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996